package com.cnpc.consumer.impl;

import cn.hutool.json.JSONUtil;
import com.cnpc.consumer.api.ITestConsumerService;
import com.cnpc.consumer.fegin.TestConsumerFegin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @date: 2020/4/24 11:03
 * @author: ruikanwang
 * @version: V0.1
 * Copyright: 2020 www.richfit.com. All rights reserved.
 */
@RestController
public class TestConsumerImpl implements ITestConsumerService {

    @Value("${test}")
    private String test;
    @Autowired
    TestConsumerFegin consumerFegin;
    @Override
    public String getTestProducer(String name) {
        return JSONUtil.toJsonStr(consumerFegin.getTestProducer(name));
    }

    @GetMapping("/test1")
    public String getTest(){
        return test;
    }
}
